#pragma once

#include <stdio.h>
#include "esp_timer.h"

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

#include "driver/i2c.h"
#include "i2c_define.h"
#include "math.h"

#include "inv_mpu_dmp_motion_driver.h"
#include "inv_mpu.h"

#define q30 1073741824.0f

int esp32_delay_ms(unsigned long num_ms);
int esp32_get_clock_ms(unsigned long *count);
int esp32_i2c_write(unsigned char slave_addr, unsigned char reg_addr, unsigned char length, unsigned char const *data);
int esp32_i2c_read(unsigned char slave_addr, unsigned char reg_addr, unsigned char length, unsigned char *data);
unsigned short inv_orientation_matrix_to_scalar(
    const signed char *mtx);
unsigned short inv_row_2_scale(const signed char *row);
uint8_t mpu_dmp_get_data(float *pitch, float *roll, float *yaw);
